/*  This file is part of the comicconquer project
    Copyright (C) 2010 Reach <reach334@gmail.com>

    ComicConquer is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This software is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public 
    License along with this software.  If not, see <http://www.gnu.org/licenses/>.

*/

#ifndef BOOKMARKDLG_H
#define BOOKMARKDLG_H

#include "mist.h"
#include "onyx/ui/onyx_dialog.h"
#include "CoListWidget.h"
#include "Configuration.h"

/**
 * Dialog for open and remove bookmarks.
 * 
 * @author reach (5/25/2010)
 */
class BookmarkDlg : public ui::OnyxDialog
{
    Q_OBJECT

    //-- constructor
public:
    BookmarkDlg(CoconProfile* profile, bool isRemove, QWidget* parent = 0);

    //-- static public methods
public:
    static void manageBookmark(CoconProfile* profile, bool isRemove = false, QWidget* parent = 0);

    //-- signals
    signals:
    void requestOpenComic(const QString& filePath);

    //-- private methods
private:
    void initList();
    void refreshScreen(ScreenProxy::Waveform w = ScreenProxy::GU, bool whole = false);

    //-- private slots
private slots:
    void selectedItem(const QModelIndex& index);
    bool event(QEvent* e);
    void keyReleaseEvent(QKeyEvent* event);
    void keyPressEvent(QKeyEvent* event);

    //-- private members
private:
    CoListWidget* m_list;
    CoListItems m_listItems;
    QString m_filePath;

    QVBoxLayout m_layout;
    CoconProfile* m_profile;
    bool m_isRemove;

};

#endif // BOOKMARKDLG_H
